﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace DiarySocial.Models
{
    public partial class Diary
    {
        public Diary(string body, int privacy, int authorId) : this()
        {
            this.AuthorId = authorId;
            this.Title = "Dear Diary";
            this.Privacy = privacy;
            this.Body = body;
            this.IsCommentClosed = false;
            this.Excerpt = body.Length > 512 ?  body.Substring(0, 512) : body;
            this.Created = DateTime.Now;
            this.Modified = DateTime.Now as DateTime?;
        }
    }
}